﻿using Microsoft.Extensions.Options;
using RuoVea.ExSugar;
using RuoVea.OmiApi.Log;

namespace RuoVea.OmiLog.Test.Controllers;

/// <summary>
/// 
/// </summary>
public class CustomizeFilterLog : ICustomizeFilterLog
{

    /// <summary>
    /// 
    /// </summary>
    public CustomizeFilterLog(IOptions<List<DbConnectionConfig>> dbConnection):base(dbConnection)
    {
    }
    /// <summary>
    /// 操作日志
    /// </summary>
    /// <param name="operation"></param>
    /// <returns></returns>
    public override bool LogOp(ExFilter.Domain.OperationVo operation)
    {
        List<string> ignoreUrls = new List<string> { "pages", "Index" };
        return ignoreUrls.Contains(operation.ActionName);
    }

    /// <summary>
    /// 操作日志
    /// </summary>
    /// <param name="operation"></param>
    /// <returns></returns>
    public override bool LogVis(ExFilter.Domain.OperationVo operation)
    {
        List<string> ignoreUrls = new List<string> { "pages", "Index" };
        return operation.Url == "/logex/pages";
    }
}
